﻿using Microsoft.AspNetCore.Mvc;
using MiniFox.Components;
using MiniFox.Infrastructure;
using MiniFox.Platform;
using MiniFox.Utility;
using MiniFox.Web.Infrastructure;
using Platform.Core;

namespace Platform.Web.Controllers
{
    /// <summary>
    /// 
    /// </summary>
    [NoCache, PublicAccessible]
    public class GeneratorController : MvcControllerBase
    {
        /// <summary>
        /// 
        /// </summary>
        [AutoWired]
        protected IGenerationService Component {  get; set; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        [HttpGet]
        public Response<string> New([FromQuery] string name)
        {
            var id = this.Component.NewId(name);
            return id.CreateResponse();
        }

    }
}
